package demo.vo.http;

import com.alibaba.fastjson.JSON;

/**
 * http response包装类
 * 
 */
public class ResponseVo extends Response {

    public ResponseVo(int responseCode, String contentType, int contentLength, long date, String content) {
        super(responseCode, contentType, contentLength, date, content);
    }

    /** 请求方式： GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE */
    private String method;

    /** 请求的URL */
    private String url;

    /** 耗时： ms */
    private Long cost;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Long getCost() {
        return cost;
    }

    public void setCost(Long responseTime) {
        this.cost = responseTime;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
